
// 原始数据格式类型
export interface OriginalSpec {

  name: string;
  values: string[];
  images: Record<string, string>;
}

export interface OriginalSkuSpec {

  spec_id: number;
  spec_name: string;
  spec_value_id: number;
  value: string;
}

export interface OriginalSku {

  id: string;
  sku_name: string;
  price: string;
  original_price?: string;
  stock: number;
  image: string | null;
  sku_code?: string;
  specs: OriginalSkuSpec[];
}

export interface OriginalCategory {
  id: string;
  name: string;
  slug: string | null;
}

export interface OriginalProduct{
  id: string;
  name: string;
  slug: string;
  price: string;
  images: string[];
  salesCount: number;
  category_id: string;
  specs: OriginalSpec[];
  sku_name: string;
  skus: OriginalSku[];
  description: string;
  category: OriginalCategory;
}

// 目标数据格式类型
export interface TargetSpec {

  name: string;
  values: string[];
  images: Record<string, string>;
}

export interface TargetSku {
  id: string;
  specs: Record<string, string>;
  price: number;
  originalPrice: number;
  stock: number;
  image: string;
  barcode: string;
  weight: string;
}

export interface TransformedProduct {
  id: string;
  name: string;
  description: string;
  category: string;
  priceRange: [number, number];
  defaultImage: string;
  images: string[];
  specs: TargetSpec[];
  skus: TargetSku[];
}